from pages.base_page import BasePage


class PersonalPage(BasePage):

    def select_year(self):
        # 向上滑动选择日期
        ele_info = self.page_eles['年']

        self.driver.swipe_on_element(ele_info, 'up')
        return self

    def select_month(self):
        # 向上滑动选择日期
        ele_info = self.page_eles['月']

        self.driver.swipe_on_element(ele_info, 'up')
        return self

    def select_day(self):
        # 向上滑动选择日期
        ele_info = self.page_eles['日']

        self.driver.swipe_on_element(ele_info, 'up')
        return self

    def slide_notification(self):
        self.driver.swipe('up')
        return self

    def unlock(self):
        self.driver.action_swipe([
            {'x': 1, 'y': 1},
            {'x': 2, 'y': 1},
            {'x': 2, 'y': 2},
            {'x': 2, 'y': 3},
            {'x': 3, 'y': 3}
        ])